import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute } from 'react-router';

import MainView from './MainView.jsx';
import RootView from './RootView.jsx';
import SingleView from './SingleView.jsx';
import DrillView from './DrillView.jsx';

import history from '../common/history.es6';

render(
  (
    <Router history={ history }>
      <Route path="/" component={MainView}>
        <Route path="domain/:domainId" component={SingleView} />
        <Route path="domain/:domainId/url/:urlId" component={SingleView} />
        <Route path="domain/:domainId/url/:urlId/:traceType/:requestTime" component={DrillView} />
        <IndexRoute component={RootView} />
      </Route>
    </Router>
  )
  , document.getElementById('root'));
